﻿Imports Seguridad

Public Class Usuario
    Inherits Recurso

    Private _nick As String
    Private _clave As String
    Private _perfil As Perfil
    Private _idioma As Idioma
    Private _bloqueado As Boolean

    Sub New()
        MyBase.Persistencia = EstadoPersistencia.INSERT
    End Sub

    Public Property Nick() As String
        Get
            Return _nick
        End Get
        Set(ByVal value As String)
            _nick = value
        End Set
    End Property
    Public Property Clave() As String
        Get
            Return Seguridad.Seguridad.Desencriptar(_clave, _nick)
        End Get
        Set(ByVal value As String)
            _clave = Seguridad.Seguridad.Encriptar(value, _nick)
        End Set
    End Property

    Public Property Perfil() As Perfil
        Get
            Return _perfil
        End Get
        Set(ByVal value As Perfil)
            _perfil = value
        End Set
    End Property
    Public Property Idioma() As Idioma
        Get
            Return _idioma
        End Get
        Set(ByVal value As Idioma)
            _idioma = value
        End Set
    End Property

    Public Property Bloqueado() As Boolean
        Get
            Return _bloqueado
        End Get
        Set(ByVal value As Boolean)
            _bloqueado = value
        End Set
    End Property

    Public Property Recurso() As Recurso
        Get
            Return Me
        End Get
        Set(value As Recurso)
            Me.OID = value.OID
        End Set
    End Property

End Class
